<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN" manifest="/misc/wei_cache_new.manifest">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no" />
<title>积分兑换</title>
<link rel="stylesheet" type="text/css" href="${ctxStatic}/member/themes/fashion/css/user.css" />
<script src="${ctxStatic}/member/themes/default/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
	function isDuiHuan(scoreExIndex){
		var score = parseInt($("#"+scoreExIndex).val());
		if(${wechatMember.consumeScore}>=score){
			return true;
		}else{
			alert("您的消费积分不足，不能进行兑换！！！");
			return false;
		}
	}
</script>
</head>
<body>
<div class="body">
  <div class="backg">
  	<div id="city">
    <p class="backp">积分礼品列表，按规则达到积分即可兑换</p>
		<ul class="csList" >
			<li><strong><font size="2" style="margin-left:10px;">您当前的消费积分：</font>
				<span  style="font-size:16px; color:#CC0000; font-family:Arial;">
					<c:if test="${wechatMember.consumeScore eq null}">0</c:if>
					<c:if test="${wechatMember.consumeScore ne null}">
						<c:if test="${wechatMember.consumeScore eq 0}">0</c:if>
					 	<c:if test="${wechatMember.consumeScore ne 0}">
					   		<fmt:formatNumber value="${wechatMember.consumeScore/1000 }" pattern="#,###.###"  minFractionDigits="3"/>
						</c:if>
					</c:if>
				</span>
				</strong>
			</li>
		</ul>
	</div>
	<div style="min-height: 425px;">
	
     <c:forEach items="${scoreExchangeList}" var="scoreEx" varStatus="abc">
       <form id="inputForm" action="${ctxFront}/member/toexchangepro" onsubmit="return isDuiHuan('scoreEx${abc.index}')" method="post" >
	       <input type="hidden" name="uid" value="${uid }" /> 
			<input	type="hidden" name="wechatId" value="${wechatId }" />
			<input	type="hidden" name="ScoreExchangeId" value="${scoreEx.id}" />
			<input	type="hidden" name="style" value="${style}"/>
		  <section class="w-goods">
		    <div class="w-gooa">
		        <div class="img-wrapper">
		         <img src="${ctxUser}/score/${scoreEx.showPic}"  width="150" height=80 style="visibility: visible; " onerror="this.src='${ctxStatic}/images/zanwutupian.jpg'">
		        </div>
		        <ul>
		          <li class="title">
		            <span class="item-name">${scoreEx.name }</span>
		          </li>
		         
		          <li class="others">
		            <ins>兑换积分：
			            <c:if test="${scoreEx.score eq null}">0</c:if>
						<c:if test="${scoreEx.score ne null}">
							<c:if test="${scoreEx.score eq 0}">0</c:if>
						 	<c:if test="${scoreEx.score ne 0}">
						 		<input	type="hidden" id="scoreEx${abc.index}" value="${scoreEx.score}" />
						   		<fmt:formatNumber value="${scoreEx.score/1000 }" pattern="#,###.###"  minFractionDigits="3"/>
							</c:if>
						</c:if>
		            </ins>
		            <input class="message-btn" value="兑换" type="submit">
		          </li>
		        </ul>
		    </div>
		  </section>
	</form>
  </c:forEach>
  <c:if test="${ empty scoreExchangeList}">
  	<div class="w-gooa" style="color:red; text-align: center;margin-top:30px;">
		 暂无积分兑换活动，敬请期待！！！
	</div>
  </c:if>
  </div>
    <c:if test="${uid ne '34' }">
		 <div class="footer">
        <p><!-- 版权所有&copy;&nbsp;&nbsp;  --><br>
		技术支持：<a href="http://www.hdzhx.com/boxin/index.html" >智讯互联</a><!-- &nbsp;&nbsp;	
		<a href="tel:03107056607">0310-7056607</a> -->
      </div>
	</c:if>
</div>
</body>
</html>
